package com.hulk.ratel.common.exception;

import com.hulk.ratel.common.constant.enums.BussErrCode;
import lombok.extern.slf4j.Slf4j;

/**
 * Created by liqingxue on 2017/11/10.
 * 重发exception
 */
@Slf4j
public class NotifyRetryRteException extends BaseRteException {

   


    private static final long serialVersionUID = 1L;


    /**
     * @param errorCode
     * @param errorMessage
     */
    public NotifyRetryRteException(String intTxnSeq, String errorCode, String errorMessage) {
        super(errorCode, errorMessage);
        this.intTxnSeq = intTxnSeq;
        log.error("intTxnSeq:{},errorCode:{},errorMessage:{}", new Object[] {
                intTxnSeq, errorCode, errorMessage });
    }

    /**
     * @param errorCode
     * @param throwable
     */
    @Deprecated
    public NotifyRetryRteException(String intTxnSeq, String errorCode, Throwable throwable) {
        super(errorCode, throwable);
        this.intTxnSeq = intTxnSeq;
        log.error("intTxnSeq:{},errorCode:{},throwable:{}", new Object[] {
                intTxnSeq, errorCode, throwable.getMessage() });
    }

    /**
     * @param errorCode
     * @param errorMessage
     * @param throwable
     */
    public NotifyRetryRteException(String intTxnSeq, String errorCode, String errorMessage,
                              Throwable throwable) {
        super(errorCode, errorMessage, throwable);
        this.intTxnSeq = intTxnSeq;
        log.error(
                "intTxnSeq:{},errorCode:{},errorMessage:{},throwable:{}",
                new Object[]{intTxnSeq, errorCode, errorMessage,
                        throwable.getMessage()});

    }
    public NotifyRetryRteException(String intTxnSeq, BussErrCode bussErrCode) {
        super(bussErrCode.getErrCode(), bussErrCode.getErrDesc());
        this.intTxnSeq = intTxnSeq;
        log.error("intTxnSeq:{},errorCode:{},errorMessage:{}", new Object[] {
                intTxnSeq, bussErrCode.getErrCode(), bussErrCode.getErrDesc() });
    }

    public NotifyRetryRteException(String intTxnSeq, BussErrCode bussErrCode,Throwable throwable) {
        super(bussErrCode.getErrCode(), bussErrCode.getErrDesc(),throwable);
        this.intTxnSeq = intTxnSeq;
        log.error(
                "intTxnSeq:{},errorCode:{},errorMessage:{},throwable:{}",
                new Object[] { intTxnSeq, bussErrCode.getErrCode(), bussErrCode.getErrDesc(),
                        throwable.getMessage() });
    }
}
